import { createRouter, createWebHistory } from 'vue-router'

// 导入框架的路由配置
import Layout from '@/layout/Layout.vue'

// 导入各模块的路由配置
import adminRoutes from '@/modules/admin/router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Layout',
      component: Layout,
      redirect: '/admin',
      children: [
        ...adminRoutes
      ]
    },
    {
      path: '/:pathMatch(.*)*',
      name: 'NotFound',
      component: () => import('@/components/NotFound.vue')
    }
  ]
})

export default router
